package cn.huiyunche.base.service.vo;

import cn.huiyunche.base.service.enums.DWaybillStatusEnum;
import cn.huiyunche.base.service.model.DWaybillVehicle;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 运单详情
 *
 * @author lm
 */
public class DWaybillDetailVo implements Serializable {

    private static final long serialVersionUID = -4020524736468180183L;

    private Long id;

    private Long deliveryID;

    private String orderCode; // 中联TMS订单编号

    private Date orderTime; // 下单时间

    private Integer status; // 运单状态

    private String statusText; // 运单状态描述

    private String departProvince; // 发车省

    private String departCity; // 发车市

    private String departCounty; // 发车区县

    private String departAddress; // 发车地址

    private String arrivalProvince; // 送达省

    private String arrivalCity; // 送达市

    private String arrivalCounty; // 送达县

    private String arrivalAddress; // 送达地址

    private String arrivalContact; // 送达联系人

    private String arrivalPhone; // 送达联系人

    private BigDecimal orderPrice; // 运单价格//合计费用

    private String customerRemark; // 备注

    private BigDecimal distance; // 里程数

    private String departAddr; // 发车地址

    private Date departTime;//发车时间

    private Date deliveryTime;//交车时间

    private Date dispatchTime; //派单时间

    private Date outsetTime;//发车时间（临牌时间，做绩效考核）

    private String driverAvatarKey; //司机头像照片key

    private String arrivalAddr; // 目的地址

    private List<DWaybillVehicle> dWaybillVehicle; // 运单车辆信息

    private Boolean isDamage; // 是否带伤运单

    private Integer damageAudit; // 是否审核通过（0:审核中，1：已通过审核，2:未通过审核）

    private List<AttachVo> accidentPics;// 事故图片列表

    private String description; // 事故描述

    // 事故申报审核状态
    private Integer auditStatus;

    // 带伤发运图片集合
    private List<AttachVo> damageAttach;

    // 交车照片
    private List<DeliveryAttachVo> deliverPics = new ArrayList<DeliveryAttachVo>(0);

    //运费
    private BigDecimal shippingFee;

    //总油费
    private BigDecimal fuelCost;

    //油量
    private BigDecimal fuelConsumption;

    //油价
    private BigDecimal oilPrice;

    List<DWaybillFeeVo> fees = new ArrayList<>();

    // 司机姓名－分供方
    private String driverName;

    // 司机电话－分供方
    private String driverPhone;

    //交车审核状态（0: 未审核，1: 已审核）
    private int deliveryCheckStatus;
    //审核失败原因
    private String deliveryCheckRemark;
    //照片地址
    private String photoAdderss;
    //是否可选择本地照片（0:否，1:是）
    private Boolean isCheckLocalPic;
    //司机照片审核，是否是本人交车
    private Boolean isSelf;

    //第一箱油油量
    private BigDecimal firstFuelTotal;

    //第一箱油油费
    private BigDecimal firstFuelOilFee;

    //油卡充值金额
    private BigDecimal remainingOilFee;

    //市场价
    private BigDecimal oilPercent;
    
    // 附加费用
    private BigDecimal extraCost;

    public void setDeliveryID(Long deliveryID) {
        this.deliveryID = deliveryID;
    }

    public Long getDeliveryID() {

        return deliveryID;
    }

    public void setDepartTime(Date departTime) {
        this.departTime = departTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public void setDriverAvatarKey(String driverAvatarKey) {
        this.driverAvatarKey = driverAvatarKey;
    }

    public Date getDepartTime() {
        return departTime;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public String getDriverAvatarKey() {
        return driverAvatarKey;
    }


    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDepartProvince() {
        return departProvince;
    }

    public void setDepartProvince(String departProvince) {
        this.departProvince = departProvince;
    }

    public String getDepartCity() {
        return departCity;
    }

    public void setDepartCity(String departCity) {
        this.departCity = departCity;
    }

    public String getDepartCounty() {
        return departCounty;
    }

    public void setDepartCounty(String departCounty) {
        this.departCounty = departCounty;
    }

    public String getArrivalProvince() {
        return arrivalProvince;
    }

    public void setArrivalProvince(String arrivalProvince) {
        this.arrivalProvince = arrivalProvince;
    }

    public String getArrivalCity() {
        return arrivalCity;
    }

    public void setArrivalCity(String arrivalCity) {
        this.arrivalCity = arrivalCity;
    }

    public String getArrivalCounty() {
        return arrivalCounty;
    }

    public void setArrivalCounty(String arrivalCounty) {
        this.arrivalCounty = arrivalCounty;
    }

    public String getArrivalAddress() {
        return arrivalAddress;
    }

    public void setArrivalAddress(String arrivalAddress) {
        this.arrivalAddress = arrivalAddress;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }

    public String getStatusText() {
        return status == null ? "" : DWaybillStatusEnum.getByValue(status).getText();
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDepartAddress() {
        return departAddress;
    }

    public void setDepartAddress(String departAddress) {
        this.departAddress = departAddress;
    }

    public String getArrivalContact() {
        if (StringUtils.isBlank(arrivalContact)) {
            return "";
        }
        if (arrivalContact.contains("／")) {
            arrivalContact.replace("／", "/");
        }
        return arrivalContact.replace("/", "");
    }

    public void setArrivalContact(String arrivalContact) {
        this.arrivalContact = arrivalContact;
    }

    public String getArrivalPhone() {
        return null == arrivalPhone ? "" : arrivalPhone;
    }

    public void setArrivalPhone(String arrivalPhone) {
        this.arrivalPhone = arrivalPhone;
    }

    public String getCustomerRemark() {
        return customerRemark;
    }

    public void setCustomerRemark(String customerRemark) {
        this.customerRemark = customerRemark;
    }

    public List<DWaybillVehicle> getdWaybillVehicle() {
        return dWaybillVehicle;
    }

    public void setdWaybillVehicle(List<DWaybillVehicle> dWaybillVehicle) {
        this.dWaybillVehicle = dWaybillVehicle;
    }

    public List<DeliveryAttachVo> getDeliverPics() {
        return deliverPics;
    }

    public void setDeliverPics(List<DeliveryAttachVo> deliverPics) {
        this.deliverPics = deliverPics;
    }

    public BigDecimal getDistance() {
        return distance;
    }

    public void setDistance(BigDecimal distance) {
        this.distance = distance;
    }

    public String getDepartAddr() {
        return departAddr;
    }

    public void setDepartAddr(String departAddr) {
        this.departAddr = departAddr;
    }

    public String getArrivalAddr() {
        return arrivalAddr;
    }

    public void setArrivalAddr(String arrivalAddr) {
        this.arrivalAddr = arrivalAddr;
    }

    public Boolean getIsDamage() {
        return isDamage;
    }

    public void setIsDamage(Boolean isDamage) {
        this.isDamage = isDamage;
    }

    public Integer getDamageAudit() {
        return damageAudit;
    }

    public void setDamageAudit(Integer damageAudit) {
        this.damageAudit = damageAudit;
    }

    public List<AttachVo> getAccidentPics() {
        return accidentPics;
    }

    public void setAccidentPics(List<AttachVo> accidentPics) {
        this.accidentPics = accidentPics;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(Integer auditStatus) {
        this.auditStatus = auditStatus;
    }

    public List<AttachVo> getDamageAttach() {
        return damageAttach;
    }

    public void setDamageAttach(List<AttachVo> damageAttach) {
        this.damageAttach = damageAttach;
    }

    public Boolean getDamage() {
        return isDamage;
    }

    public void setDamage(Boolean damage) {
        isDamage = damage;
    }

    public BigDecimal getShippingFee() {
        return shippingFee;
    }

    public void setShippingFee(BigDecimal shippingFee) {
        this.shippingFee = shippingFee;
    }

    public BigDecimal getFuelCost() {
        return fuelCost;
    }

    public void setFuelCost(BigDecimal fuelCost) {
        this.fuelCost = fuelCost;
    }

    public BigDecimal getFuelConsumption() {
        return fuelConsumption;
    }

    public void setFuelConsumption(BigDecimal fuelConsumption) {
        this.fuelConsumption = fuelConsumption;
    }

    public BigDecimal getOilPrice() {
        return oilPrice;
    }

    public void setOilPrice(BigDecimal oilPrice) {
        this.oilPrice = oilPrice;
    }

    public List<DWaybillFeeVo> getFees() {
        return fees;
    }

    public void setFees(List<DWaybillFeeVo> fees) {
        this.fees = fees;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getDriverPhone() {
        return driverPhone;
    }

    public void setDriverPhone(String driverPhone) {
        this.driverPhone = driverPhone;
    }

    public Boolean getCheckLocalPic() {
        return isCheckLocalPic;
    }

    public void setCheckLocalPic(Boolean checkLocalPic) {
        isCheckLocalPic = checkLocalPic;
    }

    public Boolean getSelf() {
        return isSelf;
    }

    public void setSelf(Boolean self) {
        isSelf = self;
    }

    public String getDeliveryCheckRemark() {
        return deliveryCheckRemark;
    }

    public void setDeliveryCheckRemark(String deliveryCheckRemark) {
        this.deliveryCheckRemark = deliveryCheckRemark;
    }

    public int getDeliveryCheckStatus() {
        return deliveryCheckStatus;
    }

    public void setDeliveryCheckStatus(int deliveryCheckStatus) {
        this.deliveryCheckStatus = deliveryCheckStatus;
    }

    public String getPhotoAdderss() {
        return photoAdderss;
    }

    public void setPhotoAdderss(String photoAdderss) {
        this.photoAdderss = photoAdderss;
    }

    public Boolean getIsCheckLocalPic() {
        return isCheckLocalPic;
    }

    public void setIsCheckLocalPic(Boolean isCheckLocalPic) {
        this.isCheckLocalPic = isCheckLocalPic;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public BigDecimal getFirstFuelTotal() {
        return firstFuelTotal;
    }

    public DWaybillDetailVo setFirstFuelTotal(BigDecimal firstFuelTotal) {
        this.firstFuelTotal = firstFuelTotal;
        return this;
    }

    public BigDecimal getFirstFuelOilFee() {
        return firstFuelOilFee;
    }

    public DWaybillDetailVo setFirstFuelOilFee(BigDecimal firstFuelOilFee) {
        this.firstFuelOilFee = firstFuelOilFee;
        return this;
    }

    public BigDecimal getRemainingOilFee() {
        return remainingOilFee;
    }

    public DWaybillDetailVo setRemainingOilFee(BigDecimal remainingOilFee) {
        this.remainingOilFee = remainingOilFee;
        return this;
    }

    public BigDecimal getOilPercent() {
        return oilPercent;
    }

    public DWaybillDetailVo setOilPercent(BigDecimal oilPercent) {
        this.oilPercent = oilPercent;
        return this;
    }

    public Date getOutsetTime() {
        return outsetTime;
    }

    public void setOutsetTime(Date outsetTime) {
        this.outsetTime = outsetTime;
    }

    public Date getDispatchTime() {
        return dispatchTime;
    }

    public void setDispatchTime(Date dispatchTime) {
        this.dispatchTime = dispatchTime;
    }
    
    public BigDecimal getExtraCost() {
		return extraCost;
	}

	public void setExtraCost(BigDecimal extraCost) {
		this.extraCost = extraCost;
	}

	@Override
    public String toString() {
        return "DWaybillDetailVo{" +
                "id=" + id +
                ", deliveryID=" + deliveryID +
                ", orderCode='" + orderCode + '\'' +
                ", orderTime=" + orderTime +
                ", status=" + status +
                ", statusText='" + statusText + '\'' +
                ", departProvince='" + departProvince + '\'' +
                ", departCity='" + departCity + '\'' +
                ", departCounty='" + departCounty + '\'' +
                ", departAddress='" + departAddress + '\'' +
                ", arrivalProvince='" + arrivalProvince + '\'' +
                ", arrivalCity='" + arrivalCity + '\'' +
                ", arrivalCounty='" + arrivalCounty + '\'' +
                ", arrivalAddress='" + arrivalAddress + '\'' +
                ", arrivalContact='" + arrivalContact + '\'' +
                ", arrivalPhone='" + arrivalPhone + '\'' +
                ", orderPrice=" + orderPrice +
                ", customerRemark='" + customerRemark + '\'' +
                ", distance=" + distance +
                ", departAddr='" + departAddr + '\'' +
                ", departTime=" + departTime +
                ", deliveryTime=" + deliveryTime +
                ", dispatchTime=" + dispatchTime +
                ", outsetTime=" + outsetTime +
                ", driverAvatarKey='" + driverAvatarKey + '\'' +
                ", arrivalAddr='" + arrivalAddr + '\'' +
                ", dWaybillVehicle=" + dWaybillVehicle +
                ", isDamage=" + isDamage +
                ", damageAudit=" + damageAudit +
                ", accidentPics=" + accidentPics +
                ", description='" + description + '\'' +
                ", auditStatus=" + auditStatus +
                ", damageAttach=" + damageAttach +
                ", deliverPics=" + deliverPics +
                ", shippingFee=" + shippingFee +
                ", fuelCost=" + fuelCost +
                ", fuelConsumption=" + fuelConsumption +
                ", oilPrice=" + oilPrice +
                ", fees=" + fees +
                ", driverName='" + driverName + '\'' +
                ", driverPhone='" + driverPhone + '\'' +
                ", deliveryCheckStatus=" + deliveryCheckStatus +
                ", deliveryCheckRemark='" + deliveryCheckRemark + '\'' +
                ", photoAdderss='" + photoAdderss + '\'' +
                ", isCheckLocalPic=" + isCheckLocalPic +
                ", isSelf=" + isSelf +
                ", firstFuelTotal=" + firstFuelTotal +
                ", firstFuelOilFee=" + firstFuelOilFee +
                ", remainingOilFee=" + remainingOilFee +
                ", oilPercent=" + oilPercent +
                ", extraCost=" + extraCost + 
                '}';
    }
}
